using System;
using ExitGames.Client.Photon;
using UnityEngine;

[Serializable]
public class PhotonPlayerProps
{
	public string weaponName;

	public string defaultWeaponName;

	public bool hasWeapon;

	[Space(10f)]
	public string armorName;

	public string hatName;

	public string bootsName;

	public string utilsName;

	[Space(10f)]
	public string skinName;

	[Space(10f)]
	public Vector3 privateCarPosition;

	public Quaternion privateCarRotation;

	public int privateCarId;

	public int carWeAreInId;

	[Space(10f)]
	public bool hasPrivateCar;

	public bool isInCar;

	public string carSkin;

	[Space(10f)]
	public int killerId;

	public bool startPVP;

	[Space(10f)]
	public string nickname = string.Empty;

	public string playerId;

	[SerializeField]
	private PlayerBehavior player;

	public PhotonPlayerProps(Hashtable hash, PlayerBehavior player)
	{
		Update(hash);
		this.player = player;
	}

	public void Update(Hashtable hash)
	{
		weaponName = (string)hash[PlayerPropsKeys.weapon];
		defaultWeaponName = (string)hash[PlayerPropsKeys.defaultWeapon];
		hasWeapon = hash.ContainsKey(PlayerPropsKeys.hasWeapon) && (bool)hash[PlayerPropsKeys.hasWeapon];
		armorName = (string)hash[PlayerPropsKeys.armor];
		hatName = (string)hash[PlayerPropsKeys.hat];
		bootsName = (string)hash[PlayerPropsKeys.boots];
		utilsName = (string)hash[PlayerPropsKeys.utils];
		skinName = (string)hash[PlayerPropsKeys.skin];
		playerId = (string)hash[PlayerPropsKeys.playerId];
		privateCarPosition = ((!hash.ContainsKey(PlayerPropsKeys.privateCarPosition)) ? Vector3.zero : ((Vector3)hash[PlayerPropsKeys.privateCarPosition]));
		privateCarRotation = ((!hash.ContainsKey(PlayerPropsKeys.privateCarRotation)) ? Quaternion.identity : ((Quaternion)hash[PlayerPropsKeys.privateCarRotation]));
		privateCarId = ((!hash.ContainsKey(PlayerPropsKeys.privateCarId)) ? (-1) : ((int)hash[PlayerPropsKeys.privateCarId]));
		carWeAreInId = ((!hash.ContainsKey(PlayerPropsKeys.carWeAreInId)) ? (-1) : ((int)hash[PlayerPropsKeys.carWeAreInId]));
		hasPrivateCar = hash.ContainsKey(PlayerPropsKeys.hasCar) && (bool)hash[PlayerPropsKeys.hasCar];
		isInCar = hash.ContainsKey(PlayerPropsKeys.isInCar) && (bool)hash[PlayerPropsKeys.isInCar];
		carSkin = (string)hash[PlayerPropsKeys.carSkin];
		killerId = ((!hash.ContainsKey(PlayerPropsKeys.killerId)) ? (-1) : ((int)hash[PlayerPropsKeys.killerId]));
		startPVP = hash.ContainsKey(PlayerPropsKeys.startPVP) && (bool)hash[PlayerPropsKeys.startPVP];
		nickname = (string)hash[PlayerPropsKeys.nickname];
	}
}
